from marajo.appengine.ext import db
from resources.project import Project

class Release(db.Model):
    """
    A single project
    """
    name = db.StringProperty(verbose_name="Name")
    status = db.StringProperty(choices=("working", "finished", "pending"), default="pending", verbose_name="Status")
    date_started = db.DateTimeProperty(auto_now_add=True, verbose_name="Date Started")
    date_due = db.DateTimeProperty(verbose_name="Date Due")
    date_finished = db.DateTimeProperty(verbose_name="Date Finished")
    project = db.ReferenceProperty(Project, collection_name="releases", verbose_name="Project")

    def __str__(self):
        return self.name
